﻿using System;
using System.Windows.Forms;

namespace _TestClient
{
	public partial class LoginForm : Form
    {
        public delegate void LoginDelegate(string account, string password);

        public LoginForm()
        {
            InitializeComponent();
        }

        #region 构造单例模式,防止出现多个同样窗口

        public static LoginForm instance;

        public static LoginForm CreateForm()
        {
            if (instance == null || instance.IsDisposed)
            {
                instance = new LoginForm();
            }
            return instance;
        }

        #endregion

        public LoginDelegate loginDeleInstance;


        /// <summary>
        /// submit
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void login_button_Click(object sender, EventArgs e)
        {
            var account = account_textBox.Text.Trim();
            var pswd = password_textBox.Text.Trim();
            loginDeleInstance.Invoke(account, pswd);
        }
	
	}
}
